package com.eorchis.module.addUser.ui.commond;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.beanutils.BeanUtils;
import org.codehaus.jackson.map.ObjectMapper;
import com.eorchis.core.page.commond.SortInfoBean;
import com.eorchis.core.ui.commond.impl.BasePageQueryCommond;
import com.eorchis.core.ui.commond.IQueryCommond;

/**
 * Title: AuditingCommond<br>
 * Description: 人员信息Commond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * 
 * @author RongSL
 * @createDate 2016-09-15
 * @version $Revision$
 */
public class UserQueryCommond extends BasePageQueryCommond implements IQueryCommond{

	private String searchUserName;//姓名
	private String searchLoginId;//登录号
	private Integer searchEnableState;//启用状态
	private String searchDepCode;//部委编号
	private Integer userNumber;//生成or删除or重置部委个数
	private String depParentId;//父节点
	private String roleCode;//角色编码
	private String[] searchUserIds;//用户id数组
	private String depId;//部门ID
	public String getSearchUserName() {
		return searchUserName;
	}
	public void setSearchUserName(String searchUserName) {
		this.searchUserName = searchUserName;
	}
	public String getSearchLoginId() {
		return searchLoginId;
	}
	public void setSearchLoginId(String searchLoginId) {
		this.searchLoginId = searchLoginId;
	}
	public Integer getSearchEnableState() {
		return searchEnableState;
	}
	public void setSearchEnableState(Integer searchEnableState) {
		this.searchEnableState = searchEnableState;
	}
	public String getSearchDepCode() {
		return searchDepCode;
	}
	public void setSearchDepCode(String searchDepCode) {
		this.searchDepCode = searchDepCode;
	}
	public Integer getUserNumber() {
		return userNumber;
	}
	public void setUserNumber(Integer userNumber) {
		this.userNumber = userNumber;
	}
	public String getDepParentId() {
		return depParentId;
	}
	public void setDepParentId(String depParentId) {
		this.depParentId = depParentId;
	}
	public String getRoleCode() {
		return roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	public String[] getSearchUserIds() {
		return searchUserIds;
	}
	public void setSearchUserIds(String[] searchUserIds) {
		this.searchUserIds = searchUserIds;
	}
	
	/**
	 * EXT 页面排序
	 */
	private SortInfoBean sortInfo = null;
	
	/**
	 * 获取排序内容
	 * 
	 * @return
	 * @author HuangS
	 * @date Jul 20, 2012
	 */
	public SortInfoBean getSortInfos() {
		return this.sortInfo;
	}
	/**
	 * 设置排序内容
	 * 
	 * @param sort
	 * @author HuangS
	 * @date Jul 25, 2012
	 */
	@SuppressWarnings("unchecked")
	public void setSort(String sort) {
		if (sort != null && !"".equals(sort)) {
			sortInfo = new SortInfoBean();
			ObjectMapper objectMapper = new ObjectMapper();
			try {
				List<LinkedHashMap<String, Object>> list = objectMapper.readValue(sort, List.class);
				for (int i = 0; i < list.size(); i++) {
					Map<String, Object> map = list.get(i);
					Set<String> set = map.keySet();
					for (Iterator<String> it = set.iterator(); it.hasNext();) {
						String key = it.next();
						BeanUtils.setProperty(sortInfo, key, map.get(key));
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	public String getDepId() {
		return depId;
	}
	public void setDepId(String depId) {
		this.depId = depId;
	}
}
